package com.optimatch.ui.model.beans;

import com.optimatch.model.db.DB;
import com.optimatch.ui.model.exceptions.DataBaseException;

public class Ville {

	private String name;
	private double latitude;
	private double longitude;
	
	public Ville(String name, double latitude, double longitude) {
		this.name = name;
		this.latitude = latitude;
		this.longitude = longitude;
	}
	
	public Ville(String name, DB db) throws DataBaseException {
		this(name,db.getLatitude(name),db.getLongitude(name));
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getLatitude() {
		return latitude;
	}
	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}
	public double getLongitude() {
		return longitude;
	}
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public String toString() {
		return this.name;
	}

}
